﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WaterRevenueMS.Domain.Common.Models;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace WaterRevenueMS.Domain.ViewModels.BasicSet.MeterState
{
    public class MeterStateModel : EntityCommon
    {
        public MeterStateModel()
        {
            Search = new SearchModel();
            TypeItems = new List<SelectListItem>
            {
                new SelectListItem{Text="通讯状态",Value="0"},
                new SelectListItem{Text="表状态",Value="1"},
                new SelectListItem{Text="电池电压状态",Value="2"}
            };
        }

        public int Id { get; set; }

        [Display(Name="仪表状态")]
        [Required(ErrorMessage="仪表状态不能为空")]
        [StringLength(16,ErrorMessage="仪表状态不能多于{1}个字符")]
        public string Yi_BZT { get; set; }

        [Display(Name = "状态代码")]
        [Required(ErrorMessage = "状态代码不能为空")]
        public string Zhuang_TDM { get; set; }

        [RegularExpression(@"\d+", ErrorMessage = "必须是数字")]
        [Display(Name="排序序号")]
        public int OrderNo { get; set; }

        public int StateType { get; set; }
        public List<SelectListItem> TypeItems { get; set; }

        public SearchModel Search { get; set; }
    }
    public class SearchModel
    {
        public SearchModel()
        {

        }

        [Display(Name = "仪表状态")]
        public string Yi_BZT { get; set; }
        [Display(Name = "状态代码")]
        public string Zhuang_TDM { get; set; }
    }
}
